<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="../../../static/css/index.css" />
    <title>从数据库查询到的数据显示到table列表中</title>
    <script src="../../../static/js/jquery-3.6.3-min.js"></script>
  </head>
  <body>
    <div><a href="/books/add">添加新书</a></div>
    <div class="tab">
      <table border="1px">
        <thead>
          <tr>
            <th>ID</th>
            <th>书名</th>
            <th>出版社</th>
            <th class="prominent">定价</th>
            <th>市场价</th>
            <th>删除</th>
            <th>修改</th>
          </tr>
        </thead>
        <tbody>
          <!-- 第一行 -->
          {% for abook in booksc %}
          <tr>
            <td>{{abook.id}}</td>
            <td>{{abook.name}}</td>
            <td>{{abook.pub}}</td>
            <td>{{abook.price}}</td>
            <td>{{abook.market_price}}</td>
            <td><a href="/books/del/{{abook.id}}">删除</a></td>
            <td><a href="/books/mod/{{abook.id}}">修改</a></td>
          </tr>
          {% endfor %}
          <!-- 第二行 -->
          <!-- <tr>
            <td>Pro 2</td>
            <td>51 ￥</td>
            <td>4587</td>
            <td>Good</td>
            <td>2009/8/12</td>
          </tr> -->
        </tbody>
      </table>
    </div>
    <script src="../../../static/js/index.js"></script>
  </body>
</html>
